package com.dgh.springboot.controller;

import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;
@Validated
@Controller
public class HelloController {
    @ResponseBody
    @RequestMapping("/hello")
    public  String hello(){
        return "hello ,DGH!";
    }

    @RequestMapping("/success")
    public  String success(Map<String, Object> map){

        map.put("name","diaoGH");
        return "success";
    }

    @RequestMapping("/")
    public  String login(Map<String, Object> map){

        return "login";
    }
}
